# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-nevergrad
pkgver=1.0.2
pkgrel=1
pkgdesc="A Python toolbox for performing gradient-free optimization"
url="https://github.com/facebookresearch/nevergrad"
arch="noarch !s390x" #py3-bayesian-optimization
license="MIT and BSD-2-Clause"
depends="python3 py3-bayesian-optimization py3-cma py3-numpy py3-pandas py3-typing-extensions"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest-xdist py3-pytest-cov"
subpackages="$pkgname-pyc"
source="https://github.com/facebookresearch/nevergrad/archive/$pkgver/nevergrad-$pkgver.tar.gz"
builddir="$srcdir/nevergrad-$pkgver"
options="!check" # several test dependencies are missing | skip tests for now

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
739f9e4a1f7f0601adfe3f7cc04c7bddcdce88e45a02de18a21d8c52477a426dbaffd84e567251e623201f72dfa3411ab9e83929c052f36e219042b4a436ffd2  nevergrad-1.0.2.tar.gz
"
